package com.itchu.system.domain;


import com.fasterxml.jackson.annotation.JsonIgnore;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import org.springframework.security.core.GrantedAuthority;
import tk.mybatis.mapper.annotation.KeySql;

import javax.persistence.Id;
import javax.persistence.Table;
import java.util.Date;

@Data
@NoArgsConstructor
@AllArgsConstructor
@Table(name = "sys_role")
public class SysRole implements GrantedAuthority {
    @Id
    @KeySql(useGeneratedKeys = true)
    private Long id;

    private String roleName;

    private String description;

    private Date createTime;

    private Date updateTime;

    @JsonIgnore
    @Override
    public String getAuthority() {
        return roleName;
    }
}
